﻿using System;
using System.Drawing;
using System.Windows.Forms;

namespace GameDesigner
{
    class GridPainter
    {
        public static int SIZE = 50;
        private int MAX = 50;

        public GridPainter(int size)
        {
            SIZE = size;
        }

        public void OnPaint(object sender, PaintEventArgs e)
        {
            Graphics g = e.Graphics;
            Pen pen = new Pen(Color.LightGray, 1);
            for (int x = 0; x < SIZE * MAX; x += SIZE)
            {
                Point p1 = new Point(x, 0);
                Point p2 = new Point(x, SIZE * MAX);
                e.Graphics.DrawLine(pen, p1, p2);
            }
            for (int y = 0; y < SIZE * MAX; y += SIZE)
            {
                Point p1 = new Point(0, y);
                Point p2 = new Point(SIZE * MAX, y);
                e.Graphics.DrawLine(pen, p1, p2);
            }
        }
    }
}
